package com.library.entity;

import javax.persistence.*;

/**
 * Entity:数据统计
 * Created by mhy on 2018/2/1.
 */
@Entity
@Table(name="Statistic")
public class Statistic {
    private Integer statisticId;   //statisticID
    private BookClass bookClass;    //图书类别
    private Integer borrowTime;     //借阅次数
    private Integer searchTime;     //搜索次数
    private String percentage;      //百分比
    private String date;            //日期
    private Staff staff;            //员工

    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    public Integer getStatisticId() {
        return statisticId;
    }
    public void setStatisticId(Integer statisticId) {
        this.statisticId = statisticId;
    }

    @ManyToOne(cascade=CascadeType.PERSIST)
    @JoinColumn(name="bookClassId")
    public BookClass getBookClass() {
        return bookClass;
    }

    public void setBookClass(BookClass bookClass) {
        this.bookClass = bookClass;
    }

    public Integer getBorrowTime() {
        return borrowTime;
    }

    public void setBorrowTime(Integer borrowTime) {
        this.borrowTime = borrowTime;
    }

    public Integer getSearchTime() {
        return searchTime;
    }

    public void setSearchTime(Integer searchTime) {
        this.searchTime = searchTime;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getPercentage() {
        return percentage;
    }

    public void setPercentage(String percentage) {
        this.percentage = percentage;
    }

    @ManyToOne(cascade=CascadeType.PERSIST)
    @JoinColumn(name="staffId")
    public Staff getStaff() {
        return staff;
    }

    public void setStaff(Staff staff) {
        this.staff = staff;
    }
}
